<?php
	     if (isloggedin()) {
	?>
	<div id="uvsq_drop_down_menu" style="display:none">
	<?php
				$menu = get_register('menu');
				$config = find_plugin_settings('uvsq');
				//print_r($config);
				global $CONFIG;

				//var_export($menu);
				include('utf8.php');

				if (is_array($menu) && sizeof($menu) > 0) {
					$alphamenu = array();
					foreach($menu as $item) {
						$alphamenu[get_plugin_setting($item->name, 'uvsq')][$item->name] = $item;
					}
					ksort($alphamenu);

			foreach ($alphamenu as $cat => $itemName) {
		?>
		<div class="menu_el">
		      <h2><?php echo !empty($cat) ? $cat : '&nbsp;' ?></h2>
		      <ul>
		      <?php

					foreach($itemName as $item) {
							$safeName = strtolower(remove_accents($item->name));
							$safeName = str_replace(' ','',$safeName);

							echo "<li><a href=\"{$item->value}\">";
							if(file_exists($CONFIG->pluginspath ."uvsq/graphics/icons/" . $safeName . ".gif")){
								echo '<img src="'.$CONFIG->wwwroot.'mod/uvsq/graphics/icons/' . $safeName . '.gif" alt="'.$item->name.'" />';
							}
							echo $item->name ."</a></li>";
					}
		     ?>
		      </ul>
		</div>	
		<?php
			}
		}
		?>
			<div class="clearfloat"></div>
	</div>
	<?php
	}
	?>
